package com.sleepcamel.resteasyConfigurator.model.command;

import org.eclipse.jface.action.Action;

import com.sleepcamel.rest.domain.TreeNode;
import com.sleepcamel.resteasyConfigurator.util.ImageDescriptorProvider;

public class RemoveNodeAction extends Action {
	
	private TreeNode node;

	public RemoveNodeAction(TreeNode node) {
		this.node = node;
		setText("R&emove "+node.getName());
		setImageDescriptor(ImageDescriptorProvider.getImageDescriptor("delete.png"));
	}

	@Override
	public void run() {
		DeleteTreeNodeCommand deleteTreeNodeCommand = new DeleteTreeNodeCommand();
		deleteTreeNodeCommand.setReceiver(node);
		deleteTreeNodeCommand.execute();
	}

}
